//
//  FootballAssistOrderHeaderView.m
//  LiveSoftware
//
//  Created by lanou3g on 15/7/18.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "FootballAssistOrderHeaderView.h"
#define kHeaderViewFont 13

@implementation FootballAssistOrderHeaderView

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        self.headerBg = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenIp6(30))];
        self.headerBg.image = [UIImage imageNamed:@"header_view_bg"];
        [self addSubview:_headerBg];
        
        CGFloat labelW1 = kScreenIp6(40);
        CGFloat teamViewW = kScreenIp6(130);
        CGFloat player_nameW = kScreenIp6(110);
        CGFloat gap = (kScreenWidth - labelW1 - teamViewW - player_nameW - labelW1 ) / 5;
        
        // 间隙
        CGFloat labelH = kScreenIp6(30);
        
        // 排名
        self.num = [[UILabel alloc] initWithFrame:CGRectMake(gap, 0, labelW1, labelH)];
        self.num.text = @"排名";
        self.num.textAlignment = NSTextAlignmentCenter;
        self.num.font = [UIFont systemFontOfSize:kHeaderViewFont];
        [self.headerBg addSubview:_num];
        
        self.player_name = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_num.frame), 0, player_nameW - kScreenIp6(10), labelH)];
        self.player_name.text = @"球员";
        self.player_name.textAlignment = NSTextAlignmentCenter;
        self.player_name.font = [UIFont systemFontOfSize:kHeaderViewFont];
        
        [self.headerBg addSubview:_player_name];
        
        self.team_name = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_player_name.frame) + gap, 0, teamViewW, labelH)];
        self.team_name.font = [UIFont systemFontOfSize:kHeaderViewFont];
        self.team_name.textAlignment = NSTextAlignmentCenter;
        self.team_name.text = @"球队";
        
        [self.headerBg addSubview:_team_name];
        
        self.assist = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_team_name.frame) + 2 * gap, 0, labelW1, labelH)];
        self.assist.text = @"助攻";
        //        _assist.backgroundColor = [UIColor redColor];
        self.assist.font = [UIFont systemFontOfSize:kHeaderViewFont];
        
        [self.headerBg addSubview:_assist];
        
        
    }
    return self;
}

@end
